<div class="bop">
    <div class="m-subheader">
        <div class="row align-items-center">
            <div class="mr-auto col-auto">
                <h3 class="m-subheader__title m-subheader__title--separator">
                    <span>总装BOP管理</span>
                </h3>
            </div>
            <div class="col text-right mt-3 mt-md-0"></div>
            <div class="col-sm-12 text-right">
                <button *ngIf="'Pages.GeneralManagement.NewTask' | permission" (click)="createTask()"
                    class="btn btn-primary"><i class="fa fa-plus"></i> 新建任务</button>
                <!-- <button (click)="createTask()"  class="btn btn-primary"><i class="fa fa-plus"></i> 质量数据导入</button>
                    <button (click)="createTask()"  class="btn btn-primary"><i class="fa fa-plus"></i> BOP导出</button> -->
            </div>
        </div>
    </div>
    <div class="m-content">
        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__body" style="margin-bottom: -20px;">
                <div class="ui-g">
                    <div class="ui-g-8" style="display: flex;">
                        <div style="margin-right: 10px;display: flex;">
                            <span style="width: 50px;line-height: 30px;">型号：</span>
                            <input type="text" name="model" size="30" pInputText [(ngModel)]="model"
                                class="form-control" />
                        </div>
                        <div style="margin-right: 10px;display: flex;">
                            <span style="width: 50px;line-height: 30px;">发次：</span>
                            <input type="text" name="lotNo" size="30" pInputText [(ngModel)]="lotNo"
                                class="form-control" />
                        </div>
                        <div style="margin-right: 10px;display: flex;">
                            <span style="width: 50px;line-height: 30px;">图号：</span>
                            <input type="text" name="drawiingNo" size="30" pInputText [(ngModel)]="drawingNo"
                                class="form-control" />
                        </div>
                    </div>
                    <div class="ui-g-3">
                        <p-button label="搜索" (onClick)="getBopList()"></p-button>
                        <p-button label="重置" (onClick)="resetSearch()" style="margin-left: 30px;"></p-button>
                        <p-button *ngIf="'Pages.GeneralManagement.ExportUser' | permission" label="导出用户"
                            (onClick)="exportPerson()" style="margin-left: 30px;margin-right: 30px;"></p-button>
                        <!-- <p-fileUpload *ngIf="saveFlag && ('Pages.GeneralManagement.RangeImport' | permission)" mode="basic" customUpload="true" chooseLabel="靶场BOP导入"
                            [style]="{'position': 'absolute'}" (uploadHandler)="myUploader($event)"
                            [(files)]="uploadedFiles" multiple="false" auto="auto">
                        </p-fileUpload> -->
                        <p-button *ngIf="saveFlag && ('Pages.GeneralManagement.RangeImport' | permission)"
                            label="靶场BOP导入" (onClick)="openDialog()">
                        </p-button>
                    </div>
                </div>
            </div>
            <div class="m-portlet__body">
                <div class="row align-items-center">
                    <!--<Primeng-TurboTable-Start>-->
                    <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                        <p-table #dataTable (onLazyLoad)="getBopList($event)" [value]="primengTableHelper.records"
                            rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false" [lazy]="true"
                            [scrollable]="true" ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
                            [resizableColumns]="primengTableHelper.resizableColumns">
                            <ng-template pTemplate="header">
                                <tr>
                                    <th style="width: 150px">操作</th>
                                    <th style="width: 150px">
                                        型号

                                    </th>
                                    <th style="width: 150px">
                                        发次

                                    </th>
                                    <th style="width: 150px">
                                        名称

                                    </th>
                                    <th style="width: 150px">
                                        图号
                                    </th>
                                    <th style="width: 150px">
                                        阶段标记

                                    </th>
                                    <!-- <th style="width: 150px">
                                        BOP状态

                                    </th> -->
                                    <!-- <th style="width: 150px" >
                                       BOP属性
                                       
                                    </th> -->
                                    <th style="width: 150px">
                                        创建人

                                    </th>
                                    <th style="width: 150px">
                                        创建时间

                                    </th>
                                    <th style="width: 150px">
                                        火箭状态

                                    </th>
                                </tr>
                            </ng-template>
                            <ng-template pTemplate="body" let-record="$implicit">
                                <tr>
                                    <td style="width: 150px">
                                        <div class="btn-group dropdown" dropdown container="body">
                                            <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                                                <i class="fa fa-cog"></i><span class="caret"></span> 操作
                                            </button>
                                            <ul class="dropdown-menu" *dropdownMenu>
                                                <li>
                                                    <a *ngIf="'Pages.GeneralManagement.BOPManagement' | permission"
                                                        href="javascript:;" (click)="toBopTree(record)">BOP管理</a>
                                                </li>
                                                <li>
                                                    <a *ngIf="'Pages.GeneralManagement.ViewResume' | permission"
                                                        href="javascript:;" (click)="lookResume(record)">查看履历</a>
                                                </li>
                                                <li>
                                                    <a *ngIf="'Pages.GeneralManagement.BOPModification' | permission"
                                                        href="javascript:;" (click)="bopEdit(record)">BOP修改</a>
                                                </li>
                                                <li>
                                                    <a *ngIf="'Pages.GeneralManagement.BOPExport' | permission"
                                                        href="javascript:;" (click)="export(record)">BOP导出</a>
                                                </li>
                                                <li>
                                                    <a *ngIf="'Pages.GeneralManagement.RangeExport' | permission"
                                                        href="javascript:;" (click)="rangeExport(record)">靶场BOP导出</a>
                                                </li>
                                                <li>
                                                    <a *ngIf="'Pages.GeneralManagement.PlanExport' | permission"
                                                        href="javascript:;" (click)="exportTask(record)">计划导出</a>
                                                </li>
                                                <li>
                                                    <a *ngIf="'Pages.GeneralManagement.BOPDelete' | permission"
                                                        href="javascript:;" (click)="bopDelete(record)">BOP删除</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.model}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.lotNo}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.modelName}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        <!-- {{getRolesAsString(record.roles)}} -->
                                        {{record.drawingNo}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"></span>
                                        {{record.stageSign}}
                                    </td>
                                    <!-- <td style="width: 150px">
                                        <span class="ui-column-title"></span>
                                        {{record.statusDesc}}
                                    </td> -->
                                    <!-- <td style="width: 150px">
                                        <span class="ui-column-title"></span>
                                        <span  *ngIf="record.property==0">工艺</span>
                                        <span  *ngIf="record.property==1">质量</span>
                                    </td> -->
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.userName}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"></span>
                                        {{record.creationTime | momentFormat:'YYYY-MM-DD HH:mm:ss'}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"></span>
                                        {{record.rocketState}}
                                    </td>
                                </tr>
                            </ng-template>
                        </p-table>
                        <!-- <div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
                            {{'NoData' | localize}}
                        </div> -->
                        <div class="primeng-paging-container">
                            <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                                (onPageChange)="getBopList($event)"
                                [totalRecords]="primengTableHelper.totalRecordsCount"
                                [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">

                            </p-paginator>
                            <span class="total-records-count">
                                {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                            </span>
                        </div>
                    </div>
                    <!--<Primeng-TurboTable-End>-->
                </div>
            </div>
        </div>
    </div>
    <!-- 新增任务弹窗 -->
    <createOrEditBopTaskModal #createOrEditBopTaskModal [editData]="rowdata" [title]="title" (modalSave)="getBopList()">
    </createOrEditBopTaskModal>
    <!-- 新增BOP -->
    <createOrEditBopModal #createOrEditBopModal (modalSave)="getBopList()" [parentInfo]="rowdata">
    </createOrEditBopModal>
    <!-- 查看履历 -->
    <app-show-resume #showResume [parentInfo]="rowdata"></app-show-resume>
    <!-- bop导出 -->
    <app-bop-export #BopExportComponent [editData]="rowdata" (modalSave)="getBopList()"></app-bop-export>
    <!-- 任务导出 -->
    <app-tsk-export #TskExportComponent [editData]="rowdata" (modalSave)="getBopList()"></app-tsk-export>
    <!-- 打开靶场导入 -->
    <p-dialog [style]="{width: '80%', minHeight:'300px',background:'#fff'}" [(header)]="exportInTitle"
        [(visible)]="exportIn" (onHide)="displayclose()" modal="modal" [responsive]="true">
        <div style="margin-right: 10px;display: flex;">
            <span style="width: 90px;line-height: 30px;">文件名称：</span>
            <input type="text" name="model" size="30" pInputText [(ngModel)]="fileName" class="form-control" />
        </div>
        <div class="modal-footer" style="justify-content: center;">
            <button pButton [disabled]="fileName == undefined" type="button" label="导入"
                (click)="alterCertificateByBusinessEv()" style="margin-left: 0.5rem"></button>
        </div>
    </p-dialog>
</div>